package tcc.gui.web.struts.componente;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import tcc.applicationService.Componente.ComponenteAS;


public class GerenciarComponenteAction extends Action {

    private static final String SUCCESS_FWD = "success";
    
    /** Creates a new instance of GerenciarComponenteAction */
    public GerenciarComponenteAction() {
    }

    @Override
    public ActionForward execute(ActionMapping mapping, ActionForm form, 
            HttpServletRequest request, HttpServletResponse response) throws Exception {
        
        GerenciarComponenteForm f = (GerenciarComponenteForm) form;
        ComponenteAS.getInstance().salvarComponente(f.getComponente());

        return mapping.findForward(SUCCESS_FWD);
    }
}
